package com.harmonk.firstscene.db.entity

import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey

@Entity(
    tableName = "event_notes",
    indices = [Index(value = ["eventNoteId"], unique = true), Index(value = ["eventId"])],
    foreignKeys = [ForeignKey(
        entity = TrafficEvent::class,
        parentColumns = ["eventId"],
        childColumns = ["eventId"],
        onDelete = ForeignKey.CASCADE
    )]
)
data class EventNote(
    @PrimaryKey(autoGenerate = true)
    val eventNoteId: Long = 0,
    val content: String = "",
    val timestamp: Long = 0,
    val latitude: Double = 0.0,
    val longitude: Double = 0.0,
    val recordLatLong: Boolean = false,
    val eventId: Long = -1
)